package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author demo
 * @since 2025-01-21
 */
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 账号
     */
    private String no;

    /**
     * 名字
     */
    private String name;

    /**
     * 密码
     */
    private String password;

    private Integer age;

    /**
     * 性别
     */
    private Integer sex;

    /**
     * 角色 0超级管理员,1管理员,2普通账户
     */
    private Integer roleId;

    /**
     * 电话
     */
    @TableField("phone_num")
    private String phoneNum;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 地址
     */
    private String address;
    /**
     * 头像
     */

    @TableField("avatar_bytes")
    @JsonIgnore
    private byte[] avatarBytes;

    @TableField("avatar_type")
    private String avatarType;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }
    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String getEmail(){
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress(){
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }

    public byte[] getAvatarBytes(){
        return avatarBytes;
    }
    public void setAvatarBytes(byte[] avatarBytes) {
        this.avatarBytes = avatarBytes;
    }

    public String getAvatarType(){
        return avatarType;
    }
    public void setAvatarType(String avatarType) {
        this.avatarType = avatarType;
    }

    @Override
    public String toString() {
        return "User{" +
            "id=" + id +
            ", no=" + no +
            ", name=" + name +
            ", password=" + password +
            ", age=" + age +
            ", sex=" + sex +
            ", roleId=" + roleId +
            ", phone_num=" + phoneNum +
            ", email=" + email +
            ", address=" + address +
            ", avatarBytes=" + avatarBytes +
            ", avatarType=" + avatarType +
        "}";
    }
}
